/**
 * Created by no1 on 2015/4/16.
 */

'use strict';

/**
 * Module dependencies.
 */

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var C = require('../config');


//var ynDB = mongoose.connection;

var poiSchema = new Schema({
    _id: String,
    poiName: String,
    tagid: Number,
    loc: {
        type: [Number],
        index: '2d'
    }
});

var userSchema = new Schema({
    _id: String,
    timeline: Number,
    loc: {
        type: [Number],
        index: '2d'
    }
});


exports.poi = mongoose.model('poi', poiSchema);
exports.user = mongoose.model('user', userSchema);
exports.initDB = function () {
    //mongoose.connect(C.mongo.uri, C.mongo.options);
};